<html>
<head><meta charset="utf-8"><title>compile-fail UI test with platform-specific error output · miri · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/index.html">miri</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/compile-fail.20UI.20test.20with.20platform-specific.20error.20output.html">compile-fail UI test with platform-specific error output</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="230656223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/compile-fail%20UI%20test%20with%20platform-specific%20error%20output/near/230656223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hyd-dev <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/compile-fail.20UI.20test.20with.20platform-specific.20error.20output.html#230656223">(Mar 17 2021 at 08:45)</a>:</h4>
<p>How do I write a UI test in <a href="https://github.com/rust-lang/miri/tree/0788188c7b586289edb878f1f5b4e23700671978/tests/compile-fail">https://github.com/rust-lang/miri/tree/0788188c7b586289edb878f1f5b4e23700671978/tests/compile-fail</a> that tests platform-specific error output?<br>
Specifically, I want to test the <code>unsupported </code>...<code> dlsym: foo</code> error message, but the "..." may be "Linux" or "macOS" in my case.<br>
I tried using <code>normalize-stderr-linux</code>/<code>normalize-stderr-macos</code>/<code>normalize-stderr-test</code> to normalize the message but none of them worked.</p>



<a name="230672196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/compile-fail%20UI%20test%20with%20platform-specific%20error%20output/near/230672196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/compile-fail.20UI.20test.20with.20platform-specific.20error.20output.html#230672196">(Mar 17 2021 at 11:07)</a>:</h4>
<p>you may have to write one test per platform and make it <code>platform-only</code></p>



<a name="230684191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/compile-fail%20UI%20test%20with%20platform-specific%20error%20output/near/230684191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hyd-dev <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/compile-fail.20UI.20test.20with.20platform-specific.20error.20output.html#230684191">(Mar 17 2021 at 12:51)</a>:</h4>
<p>That's unfortunate, since the code itself can be fully shared between Linux and macOS. <span aria-label="frown" class="emoji emoji-1f641" role="img" title="frown">:frown:</span></p>



<a name="230686218"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/compile-fail%20UI%20test%20with%20platform-specific%20error%20output/near/230686218" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/compile-fail.20UI.20test.20with.20platform-specific.20error.20output.html#230686218">(Mar 17 2021 at 13:05)</a>:</h4>
<p>you can just match part of the message</p>



<a name="230686229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/compile-fail%20UI%20test%20with%20platform-specific%20error%20output/near/230686229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/compile-fail.20UI.20test.20with.20platform-specific.20error.20output.html#230686229">(Mar 17 2021 at 13:05)</a>:</h4>
<p>if they have a shared part</p>



<a name="230689829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/269128-miri/topic/compile-fail%20UI%20test%20with%20platform-specific%20error%20output/near/230689829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hyd-dev <a href="https://rust-lang.github.io/zulip_archive/stream/269128-miri/topic/compile-fail.20UI.20test.20with.20platform-specific.20error.20output.html#230689829">(Mar 17 2021 at 13:30)</a>:</h4>
<p>That's what I'm thinking about... The only part they shared is "unsupported operation: unsupported", maybe that's sufficient in this case.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>